<!---------------------
         HOME
----------------------->
<div class="welcome-message">
    <h5>Bienvenido al instituto de terapias integrales Camino Azulh</h5>
    <div class="image"><img src="http://caminoazulh.com/wp/wp-content/uploads/2014/04/welcome-banner.gif" alt="banner"/>
    </div>
    <div class="message"><p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu</p></div>
    <div class="buttons">
        <a href="#">M&aacute;s sobre el centro</a>
        <a href="#">Lea nuestros art&iacute;culos</a>
    </div>
</div>

<div class="past-event-list">
    <h5>Eventos pasados</h5>
    <?php 
        $my_query = new WP_Query( "cat=6&paged=1&posts_per_page=2&order=desc&orderby=date" );
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">   
                    <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                    <div class="info"><span class="date"><?php the_time("M d"); ?></span> | En <span class="category"><?php echo substr($parentscategory,0,-2); ?></span></div>
                </div>
    <?php   }
        }else {
            echo "<div>no posts</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="#">Ver todos &raquo;</a></div>
</div>

<div class="next-event-list">
    <div class="wtitle">
        <h5>Pr&oacute;ximos Eventos</h5>
        <span class="triangle"></span>
    </div>
    <?php 
        $query_parameters = array(
                                'cat' => 6,
                                'paged' => 1,
                                'posts_per_page' => 3,
                                'order' => 'desc',
                                'orderby' => 'date',
                                'post_status' => array('publish', 'future')    
                        );
        $my_query = new WP_Query($query_parameters);
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">
                    <div class="post-image">
                        <?php the_post_thumbnail(); ?>
                    </div>
                    <div class="post-content">
                        <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                        <div class="line"></div>
                        <div class="excerpt"><?php echo get_the_excerpt(); ?></div>
                        <div class="extra">
                            <div class="info"><span class="date"><?php the_time("M d"); ?></span> | Categor&iacute;a: <span class="category"><?php echo substr($parentscategory,0,-2); ?> | <?php echo comments_number("0 comentarios","1 comentario","% comentarios"); ?></span></div>
                            <div class="view-more"><a href="<?php the_permalink(); ?>">Leer m&aacute;s &raquo;</a></div>
                        </div>
                    </div>
                </div>
    <?php   }
        }else {
            echo "<div>No hay eventos actualmente.</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="<?php bloginfo('url'); ?>/category/eventos">Ver todos &raquo;</a></div>
</div>

<div class="product-list">
    <div class="wtitle">
        <h5>&Uacute;ltimos productos</h5>
        <span class="triangle"></span>
    </div>
    <?php 
        $my_query = new WP_Query( "post_type=products&paged=1&posts_per_page=2&order=desc&orderby=date" );
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $post = $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">
                    <div class="post-image">
                        <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo get_post_meta(get_the_ID(), 'rt_product_image_url', true)?>&amp;w=120&amp;zc=1" alt="<?php the_title(); ?>" class="image product_image preload" />
                    </div>
                    <div class="post-content">
                        <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                        <div class="info"><span class="date"><?php the_time("d M y"); ?></span>, <span class="category"><?php echo substr($parentscategory,0,-2); ?></span></div>
                        <div class="excerpt"><?php echo get_the_excerpt(); ?></div>
                    </div>
                </div>
    <?php   }
        }else {
            echo "<div>no posts</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="#">Ver todos &raquo;</a></div>
</div>

<div class="article-list">
    <h5>Art&iacute;culos</h5>
    <?php 
        $my_query = new WP_Query( "cat=7&paged=1&posts_per_page=2&order=desc&orderby=date" );
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">   
                    <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                    <div class="info"><span class="date"><?php the_time("M d"); ?></span> | En <span class="category"><?php echo substr($parentscategory,0,-2); ?></span></div>
                </div>
    <?php   }
        }else {
            echo "<div>no posts</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="#">Ver todos &raquo;</a></div>
</div>

<!---------------------
         FOOTER
----------------------->
<div class="footer-widget">
    <div class="box four">
        <p><b>Reciba nuestras actualizaciones</b></p>
        <form class="suscription-form" action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=socialite-lifestyle', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
            <input type="hidden" value="socialite-lifestyle" name="uri"/>
            <input type="hidden" name="loc" value="es_ES"/>
            <input class="suscription-text" type="text" value="Déjanos tu correo aquí" onfocus="this.value=''; this.onfocus=null;"  name="email"/>
            <input class="suscription-button" type="submit" value="" />
        </form>
    </div>
    <div class="box four">
        <p><b>S&iacute;ganos en</b></p>
        <div class="social-networks">
            <div class="facebook"></div>
            <div class="gplus"></div>
        </div>
    </div>
    <div class="box four">
        <p><b>Ub&iacute;quenos</b></p>
        <p>Calle La Conquista 262 Dpto 502</p>
        <p>Urb El Derby - Surco, Lima - Per&uacute;</p>
    </div>
    <div class="box four last">
        <p><b>Cont&aacute;ctenos</b></p>
        <p>(01) 436-0115</p>
        <p>info@caminoazulh.com</p>
    </div>
</div>
         
<!---------------------
         SIDEBAR
----------------------->
<div class="widget-next-event-list sidebar-list">
    <h4>Pr&oacute;ximos eventos</h4>
    <?php 
        $query_parameters = array(
                                'cat' => 6,
                                'paged' => 1,
                                'posts_per_page' => 2,
                                'order' => 'desc',
                                'orderby' => 'date',
                                'post_status' => array('publish', 'future')    
                        );
        $my_query = new WP_Query($query_parameters);
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">   
                    <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                    <div class="info"><span class="date"><?php the_time("M d"); ?></span> | En <span class="category"><?php echo substr($parentscategory,0,-2); ?></span></div>
                </div>
    <?php   }
        }else {
            echo "<div>No hay eventos.</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="<?php bloginfo('url'); ?>/category/eventos">Ver todos &raquo;</a></div>
</div>

<div class="widget-article-list sidebar-list">
    <h4>Art&iacute;culos</h4>
    <?php 
        $my_query = new WP_Query( "cat=7&paged=1&posts_per_page=2&order=desc&orderby=date" );
        if ( $my_query->have_posts() ) { 
            while ( $my_query->have_posts() ) { 
                $my_query->the_post();
                $parentscategory ="";
                foreach((get_the_category()) as $category) {
                    if ($category->category_parent != 0) {
                        $parentscategory .= ' <a href="' . get_category_link($category->cat_ID) . '" title="' . $category->name . '">' . $category->name . '</a>, ';
                    }
                }
    ?>
                <div class="singe-post">   
                    <div class="title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
                    <div class="info"><span class="date"><?php the_time("M d"); ?></span> | En <span class="category"><?php echo substr($parentscategory,0,-2); ?></span></div>
                </div>
    <?php   }
        }else {
            echo "<div>No hay art&iacute;los.</div>";
        }
        wp_reset_postdata();
    ?>
    <div class="view-more"><a href="<?php bloginfo('url'); ?>/category/articulos">Ver todos &raquo;</a></div>
</div>


<div class="widget-advertise">
	<div class="image">
		<img src="http://localhost/cazul/wp-content/uploads/2014/03/sidebar1.png" alt="Imagen 1" />
	</div>
	<div class="image">
		<img src="http://localhost/cazul/wp-content/uploads/2014/03/sidebar2.png" alt="Imagen 2" />
	</div>
</div>

